Imports SchemaCodeGen

Partial Class pages_Languages_Language : Inherits CPage

#Region "Querystring"
	Public ReadOnly Property LanguageId() As Integer
		Get
			Dim id As Integer = CWeb.RequestInt("languageId")
			If id = Integer.MinValue Then CSitemap.RecordNotFound("Language", id)
			Return id
		End Get
	End Property
#End Region

#Region "Data"
	Public ReadOnly Property [Language]() As CLanguage
		Get
			Dim l As CLanguage = CLanguage.Cache.GetById(LanguageId)
			If IsNothing(l) Then CSitemap.RecordNotFound("Language", LanguageId)
			Return l
		End Get
	End Property
#End Region

#Region "Event Handlers - Page"
	Protected Overrides Sub PageLoad()
		With Me.Language
			txtLanguageName.Text = .LanguageName
			txtSets.Text = CUtilities.CountSummary(.TemplateSets, "set", "none")
			txtSets.NavigateUrl = CSitemap.TemplateSets(.LanguageId)
		End With
	End Sub
#End Region

End Class
